package com.tuju.jetpackfirstdemo.ui.bugly

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.tencent.bugly.beta.Beta
import com.tencent.bugly.crashreport.CrashReport
import com.tuju.jetpackfirstdemo.R
import kotlinx.android.synthetic.main.activity_bugly.*

class BuglyActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_bugly)
        initView()
    }

    //异常
    private fun initView() {
        btn_anr.setOnClickListener { CrashReport.testANRCrash() }
        btn_javae.setOnClickListener {
            CrashReport.testJavaCrash()
            val a = 2 / 0
        }
        btn_native.setOnClickListener { CrashReport.testNativeCrash() }
        btn_update.setOnClickListener { Beta.checkUpgrade() }
    }

}
